﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.PlcBytesObject;
using Zocono.WCS.Infrastructure.ApllicationDto.WCSTaskDto;
using Zocono.WCS.Infrastructure.ApllicationDto.WmsModel;

namespace Zocono.WCS.Domain.ScGetWMSTaskDomain
{
    public interface IScGetWMSTaskService
    {
        Task<WMSApiDomain.WebApi.HeaderResult<bool>> WCSOutTaskWork(long wmsTaskCode);
        Task<WMSApiDomain.WebApi.HeaderResult<bool>> WCSInEndTaskWork(long wmsTaskCode,string container  ,string equipment);
        Task<bool> WCSInEndTaskWork(long wmsTaskCode);
        Task<List<WCSWorkTaskInfoDto>> ScGetWorkTaskInfoAsync(string scCode, int model);

        Task<ScWorkModelInfo> ScGetScWorkModelInfoAsync(string scCode);

        Task ScUpdateScWorkModelInfoAsync(ScWorkModelInfo scWorkModelInfo);

        Task<PlcWriteDbInfo> ScGetPlcWriteDbInfoAsync(string scEquipment, string objectType);

        Task<bool> ScUpdateWorkTaskInfoAsync(WCSWorkTaskInfoDto wCSWorkTaskInfoDto);

        Task<WCSWorkTaskInfoDto> ScGetWorkTaskInfoByWcsTaskCodeAsync(int wcstaskcode);

        Task<RouteDetailInfo> GetRouteDetailInfoByIdAsync(long Id);

        Task<bool> InsertTaskRouteDetailRecordInfoAsync(TaskRouteDetailRecordInfo taskRouteDetailRecordInfo);

        Task<RouteDetailInfo> GetNextRouteDetailInfoByIdAsync(long Id);

        Task<bool> ScUpdateWorkTaskInfoRouteDetailAsync(WCSWorkTaskInfoDto wCSWorkTaskInfoDto);

        Task<WCSWorkTaskInfoDto> ScGetReEnterWorkTaskInfoAsync(int wcstaskcode);

        Task<bool> WcsUpdateReallotLocationAsync(WCSWorkTaskInfoDto wCSWorkTaskInfoDto);

        Task<WCSWorkTaskInfoDto> ScGetReallotLocationByScEquipmentAsync(string scequipment);

        Task<WCSWorkTaskInfoDto> ScGetTakeEmptyWorkTaskInfoAsync(int wcstaskcode);

        Task<bool> WcsUpdateTakeEmptyAsync(WCSWorkTaskInfoDto wCSWorkTaskInfoDto);

        /// <summary>
        /// 获取堆垛机任务
        /// </summary>
        /// <param name="scCode"></param>
        /// <param name="planarStateBOs"></param>
        /// <returns></returns>
        Task<WCSWorkTaskInfoDto> ScGetCurrentTaskInfoAsync(string scCode, List<PlanarStateBO> planarStateBOs);
        Task<WCSWorkTaskInfoDto> ScGetFirstWorkTaskInfoAsync(string scCode, List<PlanarStateBO> planarStateBOs);

        Task<int> WCSCheckSCHaveExcuecutingTaskWork(string scCode);


        /// <summary>
        /// WMS手动解绑通知WCS手动完成任务
        /// </summary>
        /// <param name="unbandinWCS"></param>
        /// <returns></returns>
        Task<Zocono.Infrastructure.Common.HeaderResult<bool>> WMSManualUnbindingNotificationAsync(UnbandinWCS unbandinWCS);

        /// <summary>
        /// 获取读plcdb配置
        /// </summary>
        /// <param name="scEquipment"></param>
        /// <param name="objectType"></param>
        /// <returns></returns>
        Task<PlcReadDbInfo> PlannerGetPlcReadDbInfoAsync(string scEquipment, string objectType);

    }
}
